home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 May (DVD) / Macworld Resource DVD May 2003.toast / Data / Software / Bonus / Database / mysql-max-3.23.55.sit / mysql-max-3.23.55-apple-darwi.1 / mysql-test / t / tablelock.test < prev    next >
Encoding:
Text File  |  2003-01-21  |  1.1 KB  |  48 lines  |  [TEXT/ttxt]

  1. #
  2. # Test of lock tables
  3. #
  4.  
  5. create table t1 ( n int auto_increment primary key);
  6. lock tables t1 write;
  7. insert into t1 values(NULL);
  8. unlock tables;
  9. check table t1;
  10. lock tables t1 write, t1 as t0 read;
  11. insert into t1 values(NULL);
  12. unlock tables;
  13. check table t1;
  14. lock tables t1 write, t1 as t0 read, t1 as t2 read;
  15. insert into t1 values(NULL);
  16. unlock tables;
  17. check table t1;
  18. lock tables t1 write, t1 as t0 write, t1 as t2 read;
  19. insert into t1 values(NULL);
  20. unlock tables;
  21. check table t1;
  22. lock tables t1 write, t1 as t0 write, t1 as t2 read, t1 as t3 read;
  23. insert into t1 values(NULL);
  24. unlock tables;
  25. check table t1;
  26. lock tables t1 write, t1 as t0 write, t1 as t2 write;
  27. insert into t1 values(NULL);
  28. unlock tables;
  29. check table t1;
  30. drop table t1;
  31.  
  32. #
  33. # Test of locking and delete of files
  34. #
  35.  
  36. CREATE TABLE t1 (a int);
  37. CREATE TABLE t2 (a int);
  38. lock tables t1 write,t1 as b write, t2 write, t2 as c read;
  39. drop table t1;
  40. drop table t2;
  41.  
  42. CREATE TABLE t1 (a int);
  43. CREATE TABLE t2 (a int);
  44. lock tables t1 write,t1 as b write, t2 write, t2 as c read;
  45. drop table t2;
  46. drop table t1;
  47. unlock tables;
  48.